#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by master on 2017/3/4

import hashlib

m = hashlib.md5()

m.update(b"hello")  # 加密字符串

m.update(b"It's me")

print(m.digest())# 加密

m.update(b"It's been a long time since last time we...")

print(m.digest())  # 2进制格式hash

print(m.hexdigest())  # 16进制格式hash
print(len(m.hexdigest()))  # 16进制格式hash
